<!-- ************************************************************************************************************ -->
<!-- fileName          : client_top.jsp 																		  -->
<!-- summary           : client端顶部   																	  			  -->
<!-- ************************************************************************************************************ -->

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page import="java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>client_top</title>
<link rel="stylesheet" type="text/css" href="/immigration/css/bootstrap/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/immigration/css/bootstrap/bootstrap-responsive.min.css">
<link rel="stylesheet" type="text/css" href="/immigration/css/layout.css"   />
<script type="text/javascript" src="/immigration/js/jquery.js"></script>
<script type="text/javascript" src="/immigration/js/bootstrap.min.js"></script>

</head>
<body>
	<div id="container" style="padding-top:2px; background-image:url(/immigration/image/top_bg.png);" >
		<div style="background:#27004f;">					<!--  紫色背景色		-->
			<div id="headContent" >
			<div style="border-bottom:#ffffff 1.5px solid; height:100px; width:98%; margin:0 auto;">
				<div id="logo" >
					<img id="logoImg" height="100" width="400" src="/immigration/image/logo.png"></img>
				</div>
		
				<div id="searchbar">
					<!--Baidu站内搜索开始-->
					<script language="javascript">
					function baidusearch () {
					var wd=document.getElementsByName("wd")[0].value;
					var link="http://www.baidu.com/s?cl=3&ct=2097152&tn=baidulocal&word="+wd;
					window.open(link); }
					</script>
					<input  name=wd size="30" style="font-size:13px; font-family: Microsoft YaHei;" value="请输入关键字"  onBlur="if (value ==''){value='请输入关键字'}" onFocus="this.select()" onClick="if(this.value=='请输入关键字')this.value=''"/>				
					<input type="submit" onclick="javascript:baidusearch()" style="font-size:13px; font-family: Microsoft YaHei;" value="搜索" />
					<!--Baidu站内搜索结束-->
				</div>	
			</div>		
			</div>
		</div>

<%
	//设置请求的字符编码以支持中文
	request.setCharacterEncoding ("utf-8");

	//获取请求参数

	//从web.xml获取全局参数
	String drv=config.getServletContext().getInitParameter("DBDriver");
	String url=config.getServletContext().getInitParameter("DBURL");
	String uid=config.getServletContext().getInitParameter("DBUser");
	String pwd=config.getServletContext().getInitParameter("DBPass");
	
	//构建SQL字符串和JDBC对象
	String strSQL = "SELECT * FROM immie0_immi.topguide t WHERE t.father_id=-1";	//所有顶部标签实例    (id, name, content_name, content, url, father_id, date)   
	Connection conn = null;
	PreparedStatement pstmt = null;	
	ResultSet rs = null;
	
	try {
		Class.forName(drv).newInstance();
		conn = DriverManager.getConnection(url,uid,pwd);
		pstmt = conn.prepareStatement(strSQL);		
		
		rs = pstmt.executeQuery();
%>
		
		<div id="menu">
			<div class="navbar" style="margin-bottom:5px;">
			  <div class="navbar-inner">
			    <div class="container">			      			 
			      		<ul class="nav ">
				      		<li style="display:inline;"><a class="tag" style="padding:5px 5px;" href="/immigration/page/client/client_index.jsp" >首页</a>	</li>	      		
<%					while(rs.next()) {		
			        	if( !rs.getString(4).isEmpty() && rs.getString(5).equals("NULL")){ //content非空， url=NULL，内部页面	
%>							<li style="display:inline;"><a class="tag" style="padding:5px 5px;" href="/immigration/page/client/client_topguide_display.jsp?CId=<%=rs.getString(1)%>&FId=<%=rs.getString(1)%>"><%= rs.getString(2) %></a></li>							
<%						}
						if( rs.getString(4).equals("NULL") && !rs.getString(5).isEmpty() ){ //content=NULL， url非空，外部链接	
%>							<li style="display:inline;"><a class="tag" style="padding:5px 5px;" href="<%=rs.getString(5)%>"><%= rs.getString(2) %></a></li>							
<%						}	
					}	
%>							<li style="display:inline;"><a class="tag" style="padding:5px 5px;" href="/immigration/page/client/client_evaluation_showScores.jsp" >在线评估</a></li>
							<li style="display:inline;"><a class="tag-end" style="padding:5px 5px;" href="/immigration/page/client/client_contact_display.jsp" >联系我们</a></li>
		      			</ul>
			    </div>
			  </div>
			</div>							
		</div>
	</div>
	
<%
	} catch (ClassNotFoundException e) {
		e.printStackTrace();
	} catch (InstantiationException e) {
	    e.printStackTrace();
	} catch (IllegalAccessException e) {
		e.printStackTrace();
	} catch (SQLException e) {
		e.printStackTrace();
	} 
	finally {
		if (rs != null) {
			rs.close();
			rs = null;
		}
		if (pstmt != null) {
			pstmt.close();
			pstmt = null;
		}		
		if (conn != null) {
			conn.close();
			conn = null;
		}
	}
%>

</body>
</html>